package com.cjm.one.custom.client;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.SecurityConstants;
import com.cjm.one.common.constant.ServerConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.model.custom.entity.CustomerBalanceRecord;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.constraints.Min;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@FeignClient(value = ServerConstants.SERVER_ONE_CUSTOM)
public interface CustomerBalanceRecordClient {
    @GetMapping("/app/customer/balance/record/info")
    @Operation(summary = "获取当前用户的余额")
    Result<BigDecimal> info();

    @GetMapping("/app/customer/balance/record/list")
    @Operation(summary="获取当前用户的余额记录列表")
    Result<Page<CustomerBalanceRecord>> list( @RequestParam(value = "current",  defaultValue = "1") Integer current ,
                                                    @RequestParam(value = "size",  defaultValue = "10") Integer size);
    @PostMapping("/app/customer/balance/record/add")
    @Operation(summary="添加余额记录")
    Result<Boolean> add(@RequestBody CustomerBalanceRecord customerBalanceRecord, @RequestHeader(SecurityConstants.FROM_SOURCE) String fromSource);
}
